const express = require('express');
const mysql = require('mysql2');
const bodyParser = require('body-parser');
const app = express();
const router = express.Router();

router.use(bodyParser.urlencoded({ extended: true }));
//数据库连接
router.use(require('./db.js'))
const users = require('./control/user.js')

//查询
router.get('/users',users.index)
//插入
router.post('/users/add', users.add)
//更新
router.post('/users/edit',users.update)
//删除
router.get('/users/del',users.del)

router.get('/users/find',users.find) 

module.exports = router;